package alidns

import (
	"strconv"

	"gitee.com/bitwormhole/cloud-aliyun-api/aliyun/openapi"
)

const myAPIDefaultVersion = "2015-01-09"

////////////////////////////////////////////////////////////////////////////////

type paramSetter struct {
	request *openapi.Request
}

func (inst *paramSetter) setParamString(name string, value string) {
	if value == "" {
		return
	}
	inst.request.SetParam(name, value)
}

func (inst *paramSetter) setParamInt64(name string, value int64) {
	if value == 0 {
		return
	}
	text := strconv.FormatInt(value, 10)
	inst.request.SetParam(name, text)
}

func (inst *paramSetter) setParamInt(name string, value int) {
	if value == 0 {
		return
	}
	text := strconv.Itoa(value)
	inst.request.SetParam(name, text)
}

func (inst *paramSetter) setParamBool(name string, value bool) {
	text := strconv.FormatBool(value)
	inst.request.SetParam(name, text)
}
